org.eclipse.vtp.framework.interactions.voice.vxml
Class Prompt

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.Action
          extended by org.eclipse.vtp.framework.interactions.voice.vxml.Prompt
All Implemented Interfaces:
VXMLConstants

public class Prompt
extends Action

The Prompt class represents the <prompt> VXML element. The prompt element is used to designate some output to be rendered to the caller. The output of a prompt can be audio, TTS, or some combination of both.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
Prompt(Output output)
          Creates a new instance of Prompt with the given output.
Prompt(Output output, boolean bargeIn)
          Creates a new instance of Prompt with the given output.
 
Method Summary
 java.util.Locale getLanguage()
          Returns the language the prompt is in.
 Output getOutput()
          Returns the output to render.
 java.lang.String getTimeout()
          Returns the prompt timeout, used for record elements only.
 boolean isBargeInEnabled()
          Returns true if the caller can barge in.
 void setBargeInEnabled(boolean bargeInEnabled)
          Sets the barge in flag.
 void setLanguage(java.util.Locale language)
          Sets the language the prompt is in.
 void setOutput(Output output)
          Sets the output to render.
 void setTimeout(java.lang.String timeout)
          Sets the prompt timeout, used for record elements only.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this condition to the supplied set.
protected  void writeOutput(org.xml.sax.ContentHandler outputHandler)
          Write the output in this prompt to the specified content handler.
 void writeWidget(org.xml.sax.ContentHandler outputHandler)
          Writes the content of this widget to an XML content handler.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Prompt

public Prompt(Output output)
       throws java.lang.NullPointerException
Creates a new instance of Prompt with the given output. By default, this prompt can be barged-in on.

Parameters:
output - The output to render.
Throws:
java.lang.NullPointerException - If the supplied output is null.

Prompt

public Prompt(Output output,
              boolean bargeIn)
       throws java.lang.NullPointerException
Creates a new instance of Prompt with the given output. The bargeIn argument governs whether or not the prompt can be cut short by caller input.

Parameters:
output - The output to render.
bargeIn - True if the caller can barge in.
Throws:
java.lang.NullPointerException - If the supplied output is null.
Method Detail

getOutput

public Output getOutput()
Returns the output to render.

Returns:
The output to render.

isBargeInEnabled

public boolean isBargeInEnabled()
Returns true if the caller can barge in.

Returns:
True if the caller can barge in.

getLanguage

public java.util.Locale getLanguage()
Returns the language the prompt is in.

Returns:
The language the prompt is in.

getTimeout

public java.lang.String getTimeout()
Returns the prompt timeout, used for record elements only.

Returns:
The prompt timeout, used for record elements only.

setOutput

public void setOutput(Output output)
               throws java.lang.NullPointerException
Sets the output to render.

Parameters:
output - The output to render.
Throws:
java.lang.NullPointerException - If the supplied output is null.

setBargeInEnabled

public void setBargeInEnabled(boolean bargeInEnabled)
Sets the barge in flag.

Parameters:
bargeInEnabled - True if the caller can barge in.

setLanguage

public void setLanguage(java.util.Locale language)
                 throws java.lang.NullPointerException
Sets the language the prompt is in.

Parameters:
language - The language the prompt is in.
Throws:
java.lang.NullPointerException - If the supplied language is null.

setTimeout

public void setTimeout(java.lang.String timeout)
                throws java.lang.IllegalArgumentException
Sets the prompt timeout, used for record elements only.

Parameters:
output - The prompt timeout, used for record elements only.
Throws:
java.lang.IllegalArgumentException - If the specified timeout is empty.

writeWidget

public void writeWidget(org.xml.sax.ContentHandler outputHandler)
                 throws java.lang.NullPointerException,
                        org.xml.sax.SAXException
Description copied from class: Widget
Writes the content of this widget to an XML content handler.

Specified by:
writeWidget in class Widget
Parameters:
outputHandler - The handler to write this widget to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of this widget fails.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this condition to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.

writeOutput

protected void writeOutput(org.xml.sax.ContentHandler outputHandler)
                    throws java.lang.NullPointerException,
                           org.xml.sax.SAXException
Write the output in this prompt to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing the output fails.